<?php
$obj = $self->getFormObject();
?>
<div id="image_tab" class="section">
	<div class="section-head">
		<h4>Post Gallery</h4>
	</div>
	<div class="section-fieldset">
		<input type="hidden" name="post_gallery" id="post_gallery" value="" />
		<table class="table" id="imageList">
			<thead>
				<tr>
					<th>Image</th>
					<th>Sort order</th>
					<th>Remove</th>
				</tr>
			</thead>
			<tbody>
				<?php foreach($obj->getGalleryImages() as $img): ?>
				<tr id="r-<?php echo $img->getId()?>">
					<td><img src="<?php echo $img->resize(175)->getUrl() ?>" alt="" title="<?php echo $img->getUrl() ?>" /></td>
					<td><input type="text" value="<?php echo $img->getSortOrder() ?>" class="input-mini" /></td>
					<td><input type="checkbox" /></td>
				</tr>
				<?php endforeach ?>
			</tbody>
		</table>
		
		<div id="fineUploader"></div>
		<div id="startUpload" class="btn btn-primary" style="margin-top: 10px;">
			<i class="icon-upload icon-white"></i>Upload now
		</div>
	</div>
</div>
<script type="text/javascript">
//<![CDATA[
initFileUpload('<?php echo App::url('admin/image/upload') ?>');
//]]>
</script>